<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head></h:head>
<h:body>
    <h:form id="one">

    <!-- 5456546b4 5-->
        <h:panelGrid columns="2">

            <h:inputText id="a" value="#{triangleBean.a}" required="true">
                <f:ajax event="change" execute="@this" render="aMes result" listener="#{triangleBean.cleanTriangle}"/>
                <f:validateRegex pattern="[0-9]+"/>
                <!--<f:validator validatorId="com.sample.app.UniversalValidator"/>-->
                <!-- <f:convertNumber integerOnly="true"/>-->

            </h:inputText>
            <h:message id="aMes" for="a" style="color: red;"/>

            <h:inputText id="b" value="#{triangleBean.b}" required="true">
                <f:ajax event="change" execute="@this" render="bMes result" listener="#{triangleBean.cleanTriangle}"/>
                <f:validateRegex pattern="[0-9]+"/>
                <!--<f:validator validatorId="com.sample.app.UniversalValidator"/>-->
            </h:inputText>
            <h:message id="bMes" for="b" style="color: red;"/>

            <h:inputText id="c" value="#{triangleBean.c}" required="true">
                <f:ajax event="change" execute="@this" render="cMes result" listener="#{triangleBean.cleanTriangle}"/>
                <f:validateRegex pattern="[0-9]+"/>
                <!--<f:validator validatorId="com.sample.app.UniversalValidator"/>-->
            </h:inputText>
            <h:message id="cMes" for="c" style="color: red;"/>
        </h:panelGrid>

        <h:commandButton value="ok" type="submit" action="#{triangleBean.getResult}">
            <!--<f:ajax -->
        </h:commandButton>

        <h:outputLabel value="#{triangleBean.triangle.error}"
                       rendered="#{not empty triangleBean.triangle and not empty triangleBean.triangle.error}"/>
        <h:panelGroup id="result">
            <h:dataTable value="#{triangleBean.description}" var="item" rendered="#{not empty triangleBean.triangle}">
                <h:column>#{item}</h:column>
            </h:dataTable>
        </h:panelGroup>

    </h:form>

</h:body>
</html>
